home *** CD-ROM | disk | FTP | other *** search
- #
- # stringfil.test
- #
- # Tests for tcl.tlib string file I/O functions.
- #---------------------------------------------------------------------------
- # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
- #
- # Permission to use, copy, modify, and distribute this software and its
- # documentation for any purpose and without fee is hereby granted, provided
- # that the above copyright notice appear in all copies. Karl Lehenbauer and
- # Mark Diekhans make no representations about the suitability of this
- # software for any purpose. It is provided "as is" without express or
- # implied warranty.
- #------------------------------------------------------------------------------
- # $Id: stringfil.test,v 2.0 1992/10/16 04:50:18 markd Rel $
- #------------------------------------------------------------------------------
- #
-
- if {[info procs test] == ""} then {source testlib.tcl}
-
- rename SAVED_UNKNOWN unknown
-
- set stringfileTestVar {a
- b
- c
- d
- e
- f
- g}
-
- unlink -nocomplain STRINGFIL.TEST
-
- test stringfile-1.1 {write_file command} {
- write_file STRINGFIL.TEST $stringfileTestVar
- } ""
-
- test stringfile-2.1 {read_file command} {
- read_file STRINGFIL.TEST
- } "$stringfileTestVar\n"
-
- test stringfile-2.2 {read_file command} {
- read_file STRINGFIL.TEST nonewline
- } "$stringfileTestVar"
-
- test stringfile-2.3 {read_file command} {
- read_file STRINGFIL.TEST 3
- } [crange $stringfileTestVar 0 2]
-
- unlink STRINGFIL.TEST
- rename unknown SAVED_UNKNOWN
-